<%@ page language="java" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%String path = request.getContextPath();%>
<script type="text/javascript" src="<%=path%>/projectjs/ImageFileUpload.js"></script>
<script type="text/javascript">
function setActiveVOValue(obj) {
	if (!iu1.validate()) {
		alert("您还有像素为：【"+iu1.need_add_pic_pixel.join(",")+"】的图片要添加，请添加图片！");
		iu1.openAddImgFrame();
		return false;
	}
	$("#active_edit_inp_customerName").attr("name","");
	return validateCallback(obj, navTabAjaxDone);
}
</script>
	<div class="pageContent">
		<form method="post" action="<%=path%>/active/saveActive.action" class="pageForm required-validate" onsubmit="return setActiveVOValue(this);">
			<input type="hidden" name="activeVO.id" value="${activeVO.id}"/>
			<div class="pageFormContent" layoutH="56">
				<p>
					<label>添加者：</label>
					<input type="text" size="20" disabled="disabled" value="${activeVO.user.name}"/>
				</p>
				<p>
					<label>发布日期：</label>
					<input type="text" size="20" disabled="disabled" value="<s:date format="yyyy-MM-dd HH:mm:ss" name="activeVO.addTime"/>"/>
				</p>
				<p>
					<label>活动标题：</label>
					<input type="text" name="activeVO.title" class="required" alt="请输入活动标题" size="30" value="${activeVO.title}"/>
				</p>
				<p>
					<label>是否置顶：</label>
					<input type="radio" name="activeVO.top" value="1"/>是
					<input type="radio" name="activeVO.top" value="0" checked="checked"/>否
				</p>
				<p>
					<label>开始时间：</label>
					<input type="text" name="activeVO.startTime" class="date required" value="<s:date format="yyyy-MM-dd HH:mm:ss" name="activeVO.startTime"/>" dateFmt="yyyy-MM-dd HH:mm:ss" readonly="true"/>
					<a class="inputDateButton" href="javascript:;">选择</a>
				</p>
				<p style="width: 50%">
					<label>结束时间：</label>
					<input type="text" name="activeVO.endTime" class="date required" value="<s:date format="yyyy-MM-dd HH:mm:ss" name="activeVO.endTime"/>" dateFmt="yyyy-MM-dd HH:mm:ss" readonly="true"/>
					<a class="inputDateButton" href="javascript:;">选择</a>
				</p>
				<p style="width: 96%">
					<label>活动商家：</label>
					<input type="hidden" value="${activeVO.customer.id}" name="activeVO.customerId"/>
					<input id="active_edit_inp_customerName" name="activeVO.customerName" value="${activeVO.customer.name}" type="text" style="width:200px" readonly="readonly" tit="请选择活动商家！"/>
					<c:if test="${SESSION_USER.customer==null}">
					<a class="btnLook" href="<%=path%>/customer/listCustomer.action?searchType=active" lookupGroup="activeVO"></a>
					</c:if>
				</p>
				<p>
					<label>是否热门：</label>
					<input type="radio" name="activeVO.is_hot" <s:if test="activeVO.is_hot==1">checked="checked"</s:if> value="1"/>是
					<input type="radio" name="activeVO.is_hot" <s:if test="activeVO.is_hot==0">checked="checked"</s:if> value="0"/>否
				</p>
				<p>
					<label>是否推荐：</label>
					<input type="radio" name="activeVO.is_recommend" <s:if test="activeVO.is_recommend==1">checked="checked"</s:if> value="1"/>是
					<input type="radio" name="activeVO.is_recommend" <s:if test="activeVO.is_recommend==0">checked="checked"</s:if> value="0"/>否
				</p>
				<p style="width: 96%">
					<label>活动说明：</label>
					<textarea name="activeVO.instruction" cols="80" rows="5" class="required">${activeVO.instruction}</textarea>
				</p>
				<p></p>
				<p></p>
				<p></p>
				<p></p>
				<p></p>
				<p></p>
				<p style="width: 96%">
					<label>活动介绍：</label>
					<textarea name="activeVO.description" cols="80" rows="5" class="required">${activeVO.description}</textarea>
				</p>
				<div class="divider" style="border:0;height:70px"></div>
				<p style="width: 98%;height: auto;">
					<label>活动图片：</label>
					<a class="button" onclick="openAddImgFrame(1);"><span>添加图片</span></a>
					<a class="btnAttach" id="add_pic_a_id1" href="<%=path%>/jsp/common/image_file_upload.jsp" lookupGroup="attachment" width="560" height="300" style="display: none"></a>
					<div class="divider" style="border:0"></div>
					<div id="pic_need_add_pixel_div1"></div>
					<div class="divider" style="border:0"></div>
					<div id="pic_content_div1" style="float: none;width:auto;padding-left: 150px;width:720px">
					<s:iterator value="activeVO.picName.split(',')" id="picName" status="i">
					<div id="pic_div_old_${i.index}" style="border:1 solid #ccc;margin-top:5px;margin-bottom:5px;padding:5px;">
						<b>图片像素：</b>宽<s:property value="#picName.split('_')[1]"/>高<s:property value="#picName.split('_')[2]"/>
						<b style="margin-left:15px">图片：</b><a href="<%=path%>/jsp/common/preview_image.jsp?folder=active&picNames=${picName}&id=${activeVO.id}" target="dialog" rel="" max="true" title="预览图片" width="700" height="480" style="margin-right: 40px">${picName}</a>
						<a href="javascript:;" onclick="removePicContent('pic_div_old_${i.index}','<s:property value="#picName.split('_')[1]"/>_<s:property value="#picName.split('_')[2]"/>','${picName}',1);">移除</a>
					</div>
					</s:iterator>
					</div>	
				</p>
			</div>
			<div class="formBar">
				<ul>
					<li><div class="buttonActive"><div class="buttonContent"><button type="submit">保存</button></div></div></li>
					<li>
						<div class="button"><div class="buttonContent"><button type="button" class="close">取消</button></div></div>
					</li>
				</ul>
			</div>
		</form>
	</div>
<script type="text/javascript">
var iu1 = new ImageUpload("${activeVO.picName}","active","1","${pageContext.request.contextPath}","activeVO.picName");
</script>